<!DOCTYPE html>
<html lang="en">

<head>
    <title>大学活动</title>
    <#include "/lx/activity/components/meta.html" />
    <#include "/lx/activity/components/stylesheets.html" />
    <link rel="stylesheet" href="/lx/activity/stylesheets/index.css?v=3">
</head>

<body>
    <div id="app">
        <div class='container'>
            <div class='item' v-for="(item, index) in list" :key="item.id" @click="goInfo(item.id)">
                <img :src="item.cover" class="bg-image" />
                <div class='mask'></div>
                <div class='content'>
                    <div class='title'>{{ item.title }}</div>
                    <div class='detail'>
                        <div class='detail-left'>
                            <div class='time'>
                                <!-- <image src='/resources/pictures/location.png' mode='widthFix'></image> -->
                                {{ item.time }}
                            </div>
                            <div class='location' v-if="item.location">
                                <!-- <image src='/resources/pictures/location.png' mode='widthFix'></image> -->
                                {{ item.location }}
                            </div>
                        </div>
                        <div class='detail-right'>
                            <div class='offline theme-background-color2' v-if="item.type == 1">线下活动<span v-if="item.status == 1"> | 已报名</span>
                            </div>
                            <div class='online theme-background-color3' v-if="item.type == 2">线上活动<span v-if="item.status == 1"> | 已报名</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <#include "/lx/activity/components/scripts.html" />
    <script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data() {
            return {
                list: []
            }
        },
        mounted: function() {
            this.init();
        },
        methods: {
            init() {
                var self = this;
                var url = '/lx/mini/activity/list';
                var params = {};
                var success = function(res) {
                    self.list = res.info.list;
                }
                var fail = function() {};
                var complete = function() {};
                request(url, params, success, fail, complete);
            },
            goInfo(id) {
                window.location.href = "/lx/mini/activity/detail?id=" + id;
            }
        }
    })
    </script>
    <script>
    // wx.ready(function() {
    //     initWXShare()
    // })
    </script>
</body>

</html>